//
//  ASConfig.h
//  AttendenceSys
//
//  Created by dfangjun on 16/2/14.
//  Copyright (c) 2016年. All rights reserved.
//

#ifndef AttendenceSys_ASConfig_h
#define AttendenceSys_ASConfig_h

// 登录地址
#define kASLoginUrl		    @"http://121.42.185.124:8080/LawSchool/"
// 访问接口前缀
#define kASUrlPrefix		@"http://121.42.185.124:8080/LawSchool/"


// 服务器响应 Json 字段
#define kASJsonReturnCode		@"flag"
#define kASJsonReturnMsg		@"failReason"
#define kASJsonData			    @"data"


// 判断响应是否成功
#define isSuccessRsp(rspJson) ([[rspJson objectForKey:kASJsonReturnCode] integerValue] == 1)

// 响应的错误信息
#define errorMsgRsp(rspJson) [rspJson objectForKey:kASJsonReturnMsg]

#define kASGettingData		@"正在获取数据..."
#define kASUpdatingData	    @"正在提交数据..."
#define kASUploadingData    @"正在上传数据..."

// 判断字段值是否是nil
#define kASIsNil(str)    if (str == nil)  str = @"";

// 设置 http 请求的 referer 字段
#define kASSetHttpReferer(mgr, url) [(mgr).requestSerializer setValue:[NSString stringWithFormat:@"%@%@", kASUrlPrefix, (url)] forHTTPHeaderField:@"Referer"]

// 设置 http 请求的 url
#define kASHttpUrl(url)    [NSString stringWithFormat:@"%@%@", kASUrlPrefix, url]


// 设置 http 请求的网络 url
#define kASHttpWebUrl(url) [NSString stringWithFormat:@"%@%@", kASLoginUrl, url]



#endif



